<?php session_start(); 
if($_SESSION['login_status']==FALSE) {
		session_destroy();
		header("location:index.php");
		exit();
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ประกันภัยรถยนต์</title>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" />
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<script src="backend/js/jquery-1.7.1.min.js"></script>
</head>

<body>
<table width="918" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="421"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="10"><img src="images/bg-hd1.jpg" width="10" height="421"></td>
        <td bgcolor="#FFFFFF"><object id="FlashID2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1117" height="432">
          <param name="movie" value="flash/header.swf">
          <param name="quality" value="high">
          <param name="wmode" value="transparent">
          <param name="swfversion" value="6.0.65.0">
          <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
          <param name="expressinstall" value="Scripts/expressInstall.swf">
          <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
          <!--[if !IE]>-->
          <object type="application/x-shockwave-flash" data="flash/header.swf" width="1117" height="432">
            <!--<![endif]-->
            <param name="quality" value="high">
            <param name="wmode" value="transparent">
            <param name="swfversion" value="6.0.65.0">
            <param name="expressinstall" value="Scripts/expressInstall.swf">
            <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
            <div>
              <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
              <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
            </div>
            <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object></td>
        <td width="9" align="right"><img src="images/bg-hd2.jpg" width="9" height="421"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9" valign="top" background="images/bgl2.jpg"><img src="images/bgl.jpg" width="9" height="338" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td background="images/bg-menu.jpg">
            <?php include "top_menu.php"; ?>
            </td>
          </tr>
          <tr>
            <td height="3" bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="3" /></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="9"><img src="images/pblog08.jpg" width="9" height="43" alt="" /></td>
                <td align="center" background="images/pblog09.jpg"><object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="874" height="39">
                  <param name="movie" value="flash/banner1.swf">
                  <param name="quality" value="high">
                  <param name="wmode" value="transparent">
                  <param name="swfversion" value="6.0.65.0">
                  <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
                  <param name="expressinstall" value="Scripts/expressInstall.swf">
                  <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
                  <!--[if !IE]>-->
                  <object type="application/x-shockwave-flash" data="flash/banner1.swf" width="874" height="39">
                    <!--<![endif]-->
                    <param name="quality" value="high">
                    <param name="wmode" value="transparent">
                    <param name="swfversion" value="6.0.65.0">
                    <param name="expressinstall" value="Scripts/expressInstall.swf">
                    <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                    <div>
                      <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                      <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                    </div>
                    <!--[if !IE]>-->
                  </object>
                  <!--<![endif]-->
                </object></td>
                <td width="9"><img src="images/pblog10.jpg" width="9" height="43" alt="" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="10"><img src="images/spacer.gif" width="1" height="10" /></td>
                </tr>
              <tr>
                <td height="14"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="20">&nbsp;</td>
                    <td background="images/pblog11.jpg"><img src="images/welcome.jpg" width="284" height="37" alt="" /></td>
                    <td width="10">&nbsp;</td>
                    </tr>
                  </table></td>
                </tr>
              <tr>
                <td height="14"><img src="images/spacer.gif" width="1" height="14" /></td>
                </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="8" bgcolor="#FFFFFF">&nbsp;</td>
                    <td width="270" valign="top" bgcolor="#212121">
                      <!--side-->
                      <?php include "side.php"; ?>
                      <!--  Side-->
                      </td>
                    <td width="18"><img src="images/spacer.gif" width="18" height="1" /></td>
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="5"><img src="images/pblog01.jpg" width="5" height="42" /></td>
                                <td background="images/pblog13.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="15">&nbsp;</td>
                                    <td><h2>หน้าสมาชิกของคุณ <?=$_SESSION['name']?></h2></td>
                                    </tr>
                                  </table></td>
                                <td width="4"><img src="images/pblog12.jpg" width="4" height="42" alt="" /></td>
                                </tr>
                              </table></td>
                            </tr>
                          <tr>
                            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="24">
                                  <script src="backend/js/jquery-ui-1.8.18.custom.min.js"></script>
                                  <link href="backend/css/admin-ui/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
                                  <script type="text/javascript">
								$(function(){
									$( "#tabs" ).tabs();
									<!--datepick-->
									$( "#from" ).datepicker({
										monthNamesShort: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
										isBE: true,
                   						autoConversionField: true,
										defaultDate: "+1w",
										changeYear:true,
										changeMonth: true,
										dateFormat:'dd/mm/yy',
										onSelect: function( selectedDate ) {
											$( "#to" ).datepicker( "option", "minDate", selectedDate );
										}
									});
									$( "#to" ).datepicker({
										monthNamesShort: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'],
										defaultDate: "+1w",
										isBE: true,
                    					autoConversionField: true,
										changeYear:true,
										changeMonth: true,
										dateFormat:'dd/mm/yy',
										onSelect: function( selectedDate ) {
											$( "#from" ).datepicker( "option", "maxDate", selectedDate );
											$('#report').html('<img style=\'margin:100px 0 100px 0;\' src=\'backend/images/loading.gif\' align="absmiddle"/>');  
											$.post(
												'center_report_ajax.php',
												{from:$('#from').val(),to:$('#to').val()},
												function(data){
													$('#report').html(data).hide().fadeIn('fast');
												}
											);	
										}
									});
									<!--report-->
									$('#report').html('<img style=\'margin:100px 0 100px 0;\' src=\'backend/images/loading.gif\' align="absmiddle"/>');  
									$.get(
										'center_report_ajax.php',
										function(data){
											$('#report').html(data).hide().fadeIn('fast');
											$('ul#icons li').hover(
												function() { $(this).addClass('ui-state-hover'); }, 
												function() { $(this).removeClass('ui-state-hover'); 
											});
									});
									<!--report-->
									$('#member').change(function(){
										$('#report').html('<img style=\'margin:100px 0 100px 0;\' src=\'backend/images/loading.gif\' align="absmiddle"/>');
										$.get(
										'center_report_ajax.php',{member_id:$('#member').val()},
										function(data){
											$('#report').html(data).hide().fadeIn('fast');
											$('ul#icons li').hover(
												function() { $(this).addClass('ui-state-hover'); }, 
												function() { $(this).removeClass('ui-state-hover'); 
											});
										});
									});
								});
								</script>
                              
                                  <div id="tabs">
                                        <ul>
                                          <li><a href="#tabs-1">รายงานศูนย์</a></li>
                                        </ul>
                                        <div id="tabs-1">
                                        	<label for="from">ค้นหาตามช่วงเวลา</label>
                                            <input type="text" id="from" name="from"/>
                                            <label for="to">ถึง</label>
                                            <input type="text" id="to" name="to"/>
                                            
                                              <select name="member" id="member">
                                              	<option value="">เลือกจากสมาชิก</option>
                                              	<?php
												$sql = "select * from tb_membership where center_id = '".$rs_log['id']."'";
												$qr = select($sql);
												$total = count($qr);
												$i=0;
												while($i<$total){
													$rs = $qr[$i];
													$i++;
													echo '<option value="'.$rs['username'].'">'.$rs['name'].'('.$rs['username'].')</option>';
												}
												?>
                                              </select>
                                            
<div id="report" align="center"></div>
                                        </div>
                                        
                                  </div>    
                                  </td>
                                </tr>
                              </table></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table>                      <!-- TemplateEndEditable --></td>
                    <td width="8" bgcolor="#FFFFFF">&nbsp;</td>
                    </tr>
                  </table></td>
                </tr>
              </table></td>
          </tr>
        </table></td>
        <td width="9" valign="top" background="images/bgr2.jpg"><img src="images/bgr.jpg" width="9" height="338" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="18"><img src="images/pblog05.jpg" width="18" height="19" alt="" /></td>
        <td background="images/pblog06.jpg">&nbsp;</td>
        <td width="18"><img src="images/pblog07.jpg" width="18" height="19" alt="" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center" class="menu2"><?php include "bot_menu.php"; ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center"><?php include 'marquee.php'; ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<script type="text/javascript">
swfobject.registerObject("FlashID");
swfobject.registerObject("FlashID2");
</script>
</body>
</html>
